<section class="wrapper">
  <!-- page start-->
  <div class="row">
    <div class="col-lg-12">
      <section class="panel">
        <header class="panel-heading">
          修改密码
        </header>
        <div class="panel-body">
          <form class="form-horizontal adminex-form" >
            <div class="form-group">
              <label class="col-sm-2 col-sm-2 control-label"><i class="bi_tian">*&nbsp</i>学号</label>
              <div class="col-sm-10">
                <input type="text" value="<%= @user.student_no %>" disabled class="form-control">
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 col-sm-2 control-label"><i class="bi_tian">*&nbsp</i>原密码</label>
              <div class="col-sm-10">
                <input type="password" name="password_pre" class="form-control" placeholder="请输入原密码">
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 col-sm-2 control-label"><i class="bi_tian">*&nbsp</i>新密码</label>
              <div class="col-sm-10">
                <input type="password" name="password_new" class="form-control" placeholder="请输入新密码">
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 col-sm-2 control-label"><i class="bi_tian">*&nbsp</i>确认密码</label>
              <div class="col-sm-10">
                <input type="password" name="password_again" class="form-control" placeholder="请重新输入新密码">
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 col-sm-2 control-label"></label>
              <div class="col-sm-10">
                <button type="button" class="btn btn-primary" id="submit_data" data-url="/admin/my/password">提交</button>
              </div>
            </div>
          </form>
        </div>
      </section>
    </div>
  </div>
  <!-- page end-->
</section>
<% content_for :js do %>
  <script type="text/javascript" charset="utf-8">
      $('#submit_data').click(function () {
          var _this = $(this);
          var url = _this.attr('data-url');
          var data = {};
          data['password_pre'] = $('input[name=password_pre]').val();
          data['password_new'] = $('input[name=password_new]').val();
          data['password_again'] = $('input[name=password_again]').val();
          doRequest(_this,url,'PUT',data);
      });
  </script>
<% end %>